/*
客服store
*/

import { defineStore } from "pinia";
import type { Ref } from "vue";
import { computed, ref } from "vue";
import {useCookies} from "vue3-cookies";
import defaults from "@src/store/defaults";
import { ISettings } from "@src/types";

const useStore = defineStore("store", () => {

  const error = ref(false);
  const status = ref("idle");

  const activeSidebarComponent = ref("messages")
  const conversationOpen = ref("close")
  const settings: Ref<ISettings> = ref(defaults.customerSetting);
  
  const getStatus = computed(() => status);

  return {
    // status refs
    conversationOpen,
    activeSidebarComponent,
    status,
    getStatus,
    settings,
    error
  };
});

export default useStore;
